/**
 * Created by zl on 2017/4/17.
 */
angular.module('charityApp')
    .component('bankInfo', {
        templateUrl: 'web/pages/slider/bankinfo.html'
    })
    .component('sliderCharity', {
        templateUrl: 'web/pages/slider/slider.html',
        controller: 'slideController'
    })
    .controller('slideController', ['$scope', function ($scope) {

        $scope.donateList = window.LOCAL_STORE.context.session.donationList;

        setTimeout(function () {
            var marquee = document.getElementById('marquee');
            var offset = 0;
            var scrollheight = marquee.offsetHeight;
            var firstNode = marquee.children[0].cloneNode(true);
            marquee.appendChild(firstNode);
            setInterval(function () {
                if (offset == scrollheight) {
                    offset = 0;
                }
                marquee.style.marginTop = "-" + offset + "px";
                offset += 1;
            }, 50);
        }, 50);

    }]);
